<template>
  <!-----------首页轮播图部分开始------------->
  <div class="heart">
    <div class="main">
      <!--焦点图模块-->
      <div class="foucs"><Carousel :list="bannerList" /></div>
      <!--快报模块-->
      <div class="newsflash">
        <div class="news">
          <div class="news-hd">
            <h5>京东快报</h5>
            <a href="#" class="more">更多</a>
          </div>
          <div class="news-bd">
            <ul>
              <li>
                <a href="#">
                  <span class="news-tag">最新</span>
                  中华老字号同仁堂：“同修仁德，大人小孩都爱吃”
                </a>
              </li>
              <li>
                <a href="#">
                  <span class="news-tag">最新</span>
                  中华老字号同仁堂：“同修仁德，大人小孩都爱吃”
                </a>
              </li>
              <li>
                <a href="#">
                  <span class="news-tag">最新</span>
                  中华老字号同仁堂：“同修仁德，大人小孩都爱吃”
                </a>
              </li>
              <li>
                <a href="#">
                  <span class="news-tag">最新</span>
                  中华老字号同仁堂：“同修仁德，大人小孩都爱吃”
                </a>
              </li>
              <li>
                <a href="#">
                  <span class="news-tag">最新</span>
                  中华老字号同仁堂：“同修仁德，大人小孩都爱吃”
                </a>
              </li>
            </ul>
          </div>
        </div>
        <div class="lifeservice">
          <ul>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
          </ul>
        </div>
        <div class="bargain">
          <a href="#"><img src="./upload/bargain.png" alt="图片加载失败" /></a>
        </div>
      </div>
    </div>
  </div>
  <!-----------首页轮播图结束------------->
</template>

<script>
import { mapState } from "vuex";
export default {
  name: "",
  mounted() {
    //派发action，通知vuex发起ajax请求
    this.$store.dispatch("getBannerList");
  },
  computed: {
    ...mapState({
      bannerList: (state) => state.home.bannerList,
    }),
  },
};
</script>

<style lang="css" scoped>
.main {
  width: 980px;
  height: 455px;
  margin-left: 220px;
  margin-top: 5px;
}
.newsflash {
  float: right;
  width: 250px;
  height: 455px;
}
.foucs {
  float: left;
  width: 721px;
  height: 100%;
}
.news {
  width: 100%;
  height: 165px;
  border: 1px solid #e4e4e4;
}
.lifeservice {
  width: 100%;
  height: 209px;
  border: 1px solid #e4e4e4;
  border-top: 0;
  overflow: hidden;
}
.lifeservice ul {
  width: 252px;
}
.lifeservice ul li {
  float: left;
  width: 63px;
  height: 71px;
  border-right: 1px solid #e4e4e4;
  border-bottom: 1px solid #e4e4e4;
  text-align: center;
}
.lifeservice ul i {
  display: inline-block;
  width: 61px;
  height: 40px;
  background: url(~@/assets/images/icons.png) no-repeat;
  background-position: 0px 0px;
}
.bargain {
  position: relative;
  width: 100%;
  height: 78px;
  overflow: hidden;
  margin-top: 3px;
}
.bargain img {
  position: absolute;
  top: -30px;
  left: 0;
  width: 100%;
}
.news-hd {
  width: 100%;
  height: 33px;
  line-height: 33px;
  border-bottom: 1px dotted #e4e4e4;
  padding: 0 5px;
}
.news-hd h5 {
  float: left;
  font-size: 14px;
  color: #333;
}
.news-hd .more {
  float: right;
}
.news-hd .more::after {
  content: "\e8d2";
  font-family: "iconfont";
}
.news-bd {
  padding: 5px 15px 0;
}
.news-bd li {
  height: 24px;
  line-height: 24px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.news-bd li .news-tag {
  display: inline-block;
  height: 16px;
  width: 35px;
  background-color: rgba(225, 37, 27, 0.08);
  color: #e2231a;
  text-align: center;
  line-height: 16px;
}
</style>
